﻿using PhuLeBooze.UICode;
using PhuLeBussinessObject.News;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PhuLeBooze
{
    public partial class ucNews : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string htmlNews = "";
            string partern = "<h2 class=\"title\"><a href=\"newsdetail.aspx?id={0}\" newsID=\"{0}\" title=\"{1}\"  class=\"newsdetail\">{1}</a></h2>"
                              +"<p>{2}</p>"
                               + "<a href=\"newsdetail.aspx?id={0}\"  newsID=\"{0}\" title=\"{1}\"  class=\"newsdetail\">Chi tiết »</a>";
            CNewUI ui = new CNewUI();
            IList<CNews> list = ui.GetTop("TOP1");
            foreach (CNews item in list)
            {
                htmlNews += string.Format(partern,  item.ID,item.Title,  item.Summary, item.ThumbnailImage);

            }
            ltrDetail.Text = htmlNews;
        }
    }
}